import { http } from '@/http';

interface LoginParams {
  data: {
    username: string;
    password: string;
  };
}

interface LoginResponse {
  id: number;
  aff: number;
  username: string;
  token: string;
}

export default {
  // 登入
  login: (params: LoginParams) => {
    return http<LoginResponse>('post', '/union/login/login', params.data);
  },

  // 登出
  logout: ({ data = null, config = {} } = {}) => {
    return http('post', '/union/login/logout', data, config);
  },
};
